<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>病案浏览日志查询页</title>
</head>
<body>
	<div class="easyui-panel" data-options="fit:true,border:0">
		<div id="broLogQueryBar">
			 <span class="paddingTBL">
				<label style="width:65px;">出院日期&nbsp;</label>
				<input type="text" class="easyui-datebox" id="broLogQuery_fcydate1" data-options="width:115,height:24"/>
				<label>&nbsp;至&nbsp;</label>
				<input type="text" class="easyui-datebox" id="broLogQuery_fcydate2" data-options="width:115,height:24"/>
				<label class="paddingL">浏览人&nbsp;</label>
				<input type="text" class="" id="broLogQuery_browseName" data-options="width:120,height:24"/>
			</span>
			 
		   <span class="paddingLB"  style="width:320px;border:0px solid red"> 
			    <select class="easyui-combobox" id="broLogQuery_type" data-options="width:90,height:24">
					<option value="0" selected="selected">出院科室</option>
		            <option value="1">登录科室</option>
			    </select>  
			    <input type="text" class="" id="broLogQuery_fcydept" data-options="width:115,height:24"/>
			    
			    <span class="paddingbtn"></span>
			    <a href="#" class="easyui-linkbutton" onclick="broLogQuery()">检 索</a>
	      </span> 
		    
		</div>
		<table id="broLogQueryGrid"></table>
		
	</div>
	
<script type="text/javascript">
//获取出院科室
$("#broLogQuery_fcydept").combobox({
	url:ctx + "/MedicalShootManage/getDept",
	valueField:"ftykh",
	textField:"fksname",
	width:120, 
	height:24,
	onLoadSuccess : function() {
		$('#broLogQuery_fcydept').combobox('select', 'TZYQY');
	}
});

//获取所有浏览人
$("#broLogQuery_browseName").combobox({
	url:ctx + "/Archiving/getAllBrowseName",
	valueField:"fusercode",
	textField:"fusername",
	width:120, 
	height:24
});

//查询
function broLogQuery(){
	var date1 = $("#broLogQuery_fcydate1").datebox("getValue");
	var date2 = $("#broLogQuery_fcydate2").datebox("getValue");
	var fcydept = $("#broLogQuery_fcydept").combobox("getValue");
	var type = $("#broLogQuery_type").combobox("getValue");
	var browseName = $("#broLogQuery_browseName").combobox("getValue");
	$("#broLogQueryGrid").datagrid({
		url:ctx + "/Archiving/queryBrowseLog",
		queryParams:{
			"date1" : date1,
			"date2" : date2,
			"fcydept" : fcydept,
			"browseName" : browseName,
			"type" : type
			
		}
	});
}
//初始化表格
$("#broLogQueryGrid").datagrid({
		toolbar:"#broLogQueryBar",
		rownumbers:true,
		fitColumns:true,
		border : false,
		striped : true,
		fit : true,
		singleSelect: true,
		pagination : true,
		pageSize : 20,
		pageList : [ 20, 30,50 ],
		columns:[[
			{field:'fusername',title:'调阅人',width:100,align:'center'},  
			{field:'fdate',title:'调阅日期',width:100,align:'center',
				formatter:function(value){
					return new Date(value).format("yyyy-MM-dd");
				}		
			},  
			{field:'ip',title:'调阅终端IP',width:160,align:'center'},  
			{field:'fprn',title:'病案号',width:120,align:'center'},  
			{field:'ftimes',title:'次数',width:50,align:'center'},  
			{field:'fname',title:'姓名',width:80,align:'center'},  
			{field:'fsex',title:'性别',width:50,align:'center'},  
			{field:'fcydate',title:'出院日期',width:100,align:'center',
				formatter:function(value){
					return new Date(value).format("yyyy-MM-dd");
				}	
			},  
			{field:'fcydept',title:'出院科室',width:100,align:'center'},  
			{field:'fbarcode',title:'条码号',width:160,align:'center'}  
			
		   ]]
	});
	
</script>
</body>
</html>